﻿using System.Collections.ObjectModel;

namespace MiniFox.Net.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public sealed class ServiceSettingCollection : KeyedCollection<string, ServiceSetting>, IServiceSettingCollection
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        protected override string GetKeyForItem(ServiceSetting item)
        {
            return item.Name;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        IServiceSetting IServiceSettingCollection.this[string name] => this[name];
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        IEnumerator<IServiceSetting> IEnumerable<IServiceSetting>.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}
